<!DOCTYPE html>
<html>
    <head>
        <title>爱淘爱生活</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="initial-scale=1,maximum-scale=1">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
        <link rel="stylesheet" type="text/css" href="/source/site.css?<?=\Config\System::$site['version']?>">
        <link rel="shortcut icon" href="/source/icon.png">
    </head>
    <body>
        <div class="page-group">
            <div class="page">
                <header class="bar">
                    <h1 class="title">
                        红包统计
                    </h1>
                </header>

                <?php
                include TPL_PATH . 'toolBar.html';
                ?>

                <div class="content tab-main-list">
                    <div class="buttons-tab my-tab packet-tj">
                        <a href="#pr" class="tab-link button<?php if($tab_type == 'pr'): ?> active<?php endif;?>">近期发放红包</a>
                        <a href="#pa" class="tab-link button<?php if($tab_type == 'pa'): ?> active<?php endif;?>">红包总榜</a>
                        <a href="#pm" class="tab-link button<?php if($tab_type == 'pm'): ?> active<?php endif;?>">红包月榜</a>
                    </div>
                    <?php if ($tj): ?>
                    <div class="card index-frame">
                        <div class="card-content help-frame bigfont">
                            <a><?=date('Y-m-d', $tj['minDate'])?> ~ <?=date('Y-m-d', $tj['maxDate'])?>, 已发放红包<?=$tj['totalPacket']?>元</a>
                        </div>
                    </div>
                    <?php endif; ?>
                    
                    <?php if ($data_list): ?>
                    <?php foreach ($data_list as $d): ?>
                    <div class="card">
                        <div class="card-content">
                            <div id="give-success-note">
                                <span class="bigfont">订单号: <?=\Common::pwdOrderId($d['order_id'])?></span>
                                <br><span class="font-gray line-highter bigfont"><?=$d['username']?></span>
                                <br>---------------------------------
                                <?php foreach ($d['itemList'] as $item): ?>
                                <?php if($item['red_packet'] > 0): ?>
                                <br>★<?=$item['title']?>, 付款<?=$item['payment']?>元, 可领红包<?=$item['red_packet']?>元
                                <?php endif; ?>
                                <?php endforeach; ?>
                                <br>---------------------------------
                                <br><span class="red bigfont">已领红包<?=$d['total_packet']?>元</span>
                                <?php if($d['packet_time']): ?><br><?=date('Y-m-d H:i:s', $d['packet_time'])?><?php endif; ?>
                            </div>
                        </div>
                    </div>
                    <?php endforeach; ?>
                    <?php endif; ?>
                    <?php 
                    include TPL_PATH . 'panel.html';
                    ?>
                </div>
            </div>
        </div>
        <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
        <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
        <script type="text/javascript" src="/source/tab.js?v=?<?=\Config\System::$site['version']?>"></script>
    </body>
</html>
